#ifndef _MAC_SIGNATURE_MESSAGE_HPP
#define _MAC_SIGNATURE_MESSAGE_HPP 1

#include <vector>
#include <boost/shared_ptr.hpp>
#include "MacBytes.hpp"
#include "VerifiedMessageBase.hpp"

namespace BFT
{
	namespace messages
	{
		class MacSignatureMessage : public VerifiedMessageBase
		{
			public:
			
			MacSignatureMessage(uint16_t _tag, uint32_t _size, int _row_count, int _row_size);
			
			MacSignatureMessage(boost::shared_ptr<char> _bytes, int _bytes_size);
			
			static uint32_t computeAuthenticationSize(int _row_count, int _row_size);
			
			void setMacArray(int _index, std::vector<boost::shared_ptr<MacBytes> > _row);
			
			std::vector<boost::shared_ptr<MacBytes> > getMacArray (int _index, int _row_length);
			
			protected:
			
			int authenticationStartIndex(); //inlined
			int macStartIndex();//inlined
			std::vector<std::vector< boost::shared_ptr<MacBytes> > > internalBytes;	
		};
		
		inline int MacSignatureMessage::authenticationStartIndex() {return getOffset() + getPayloadSize();}
		inline int MacSignatureMessage::macStartIndex() {return getOffset() + getPayloadSize();}
	}
}

#endif
